import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import nodejs from '@feidao/web/atom/browser/msg/nodejs';
import render from '@feidao/web/atom/browser/render/render';

export default async function a002(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	// 调用事件
	// 考场编号
	const exam_room_id = args[0][0];
	const data = await nodejs(fd.data.spaceid, 'exam_room_date_find', { criteria: { exam_room_id }, page_size: 0, page_no: 1 });
	const n = fd.data.node.querySelector<HTMLImageElement>('[data-feidao-id="img_address"]');
	if (data.count === 0) {
		// 默认不筛选数据
		n.src = '';
	} else {
		const d = data.dataArray[0];
		n.src = d.pic_path;
	}
}
